<?php

namespace App\Http\Controllers;

use App\Http\Model\OutJson;
use App\Http\Services\ConfigServices;
use Laravel\Lumen\Routing\Controller as BaseController;

//header("Access-Control-Allow-Origin: *");

class Controller extends BaseController
{
    public function __construct()
    {
        header("Access-Control-Allow-Origin: *");
        header('Access-Control-Allow-Origin:*');
        header('Access-Control-Allow-Methods:GET,POST,PATCH,PUT,OPTIONS');

    }

    public function checkActivityDate($type, $key, $desc = '活动时间错误')
    {
        $config = new  ConfigServices();
        $check_date = $config->checkConfigDate($type, time(), $key);
        if (!$check_date) {
            write_log('dishTimeOut', 'timeError', []);
            OutJson::toJson(3001, $desc, []);
        }
    }

}
